using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Bounce
{
    public class Goal
    {
        public Goal(Vector2 vPosition, Texture2D oTexture)
        {
            Texture = oTexture;

            Position_Rim_Left = vPosition - (Vector2.UnitX * RIM_SIZE);
            Position_Rim_Right = vPosition + (Vector2.UnitX * RIM_SIZE);

            Origin = new Vector2(oTexture.Width, oTexture.Height);
            Origin *= 0.5f;
            float fScale = (RIM_RADIUS * 2) / oTexture.Width;
            Scale = new Vector2(fScale);
        }

        public void Draw(SpriteBatch oSpriteBatch)
        {
            oSpriteBatch.Draw(
                Texture, Position_Rim_Left, null, Color.Black, 0.0f, Origin, Scale, SpriteEffects.None, 0.5f);

            oSpriteBatch.Draw(
                Texture, Position_Rim_Right, null, Color.Black, 0.0f, Origin, Scale, SpriteEffects.None, 0.5f);
        }

        public Vector2 Origin
        {
            get;
            protected set;
        }

        public Vector2 Scale
        {
            get;
            protected set;
        }

        public Texture2D Texture
        {
            get;
            protected set;
        }

        public Vector2 Position_Rim_Left;
        public Vector2 Position_Rim_Right;

        public const float RIM_RADIUS = 20.0f;
        public const float RIM_SIZE = 75.0f;

    }
}
